package db;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class test extends HttpServlet {
	public void doPost(HttpServletRequest request,HttpServletResponse response)
										throws ServletException, IOException {
		response.setContentType("text/html");
		PrintWriter out = response.getWriter();


		String dbtype = null;
		BufferedReader input = null;
		try {
            input = new BufferedReader(new FileReader(new File("../webapps/ROOT/database.properties")));
            String ch = null;

            while((ch = input.readLine())!=null) {
                String[] s = ch.split(":");
                if (s[0].equals("DBType")) dbtype = s[1];
            }
        } catch (IOException e) {
            System.err.println(e);
        } finally {
            try {
                if (input!= null) {
                    input.close();
                }
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }

		out.println("<html><head></head><body>");
		out.println(dbtype+"</body></html>");
        out.close();
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
	    throws ServletException, IOException {
			doPost(request, response);
	}
}